import request from '@/utils/iasRequest'
import request1 from '@/utils/request'

export function batchFirstAuditAgree(val) {
  return request({
    url: '/new-item/batchFirstAuditAgree',
    method: 'post',
    data: { ids: val }
  })
}

export function batchFirstAuditReject(val, rejectRemark) {
  return request({
    url: '/new-item/batchFirstAuditReject',
    method: 'post',
    data: { ids: val, rejectMsg: rejectRemark }
  })
}

export function sumitItemInfo(val) {
  return request({
    url: '/item/sumitItemInfo',
    method: 'post',
    data: val
  })
}

export function uploadExcel(data) {
  return request({
    url: '/new-item/uploadNewItemExcel',
    headers: { 'Content-Type': 'multipart/form-data' },
    method: 'put',
    timeout: 600000,
    data
  })
}

export function saveItemInfo(data) {
  return request({
    url: '/new-item/saveItemInfo',
    method: 'post',
    data: data
  })
}

export function batchChangeBuyer(val, changeBuyerId) {
  return request({
    url: '/new-item/batchChangeBuyer',
    method: 'post',
    data: { ids: val, changeBuyerId: changeBuyerId }
  })
}

export function batchValidate(val) {
  return request({
    url: '/new-item/batchValidate',
    method: 'post',
    timeout: 600000,
    data: val
  })
}

export function get(val) {
  return request({
    url: '/new-item/get?id=' + val,
    method: 'get'
  })
}

export function submitBPMS(val) {
  return request({
    url: '/new-item/submitBPMS',
    method: 'post',
    data: val
  })
}

export function createNewItem(data) {
  return request({
    url: '/new-item/createNewItem',
    headers: { 'Content-Type': 'multipart/form-data' },
    method: 'put',
    data
  })
}

export function batchUpdateFilePath(val) {
  return request({
    url: '/new-item/batchUpdateFilePath',
    method: 'post',
    data: val
  })
}

export function batchMDAAuditAgree(val) {
  return request({
    url: '/new-item/batchMDAAuditAgree',
    method: 'post',
    data: { ids: val }
  })
}

export function batchMDAAuditReject(val, rejectRemark) {
  return request({
    url: '/new-item/batchMDAAuditReject',
    method: 'post',
    data: { ids: val, rejectMsg: rejectRemark }
  })
}

export function batchItemFileAuditAgree(val) {
  return request({
    url: '/new-item/batchItemFileAuditAgree',
    method: 'post',
    data: { batchRecordId: val }
  })
}

export function batchItemFileAuditReject(val, rejectRemark) {
  return request({
    url: '/new-item/batchItemFileAuditReject',
    method: 'post',
    data: { batchRecordId: val, rejectMsg: rejectRemark }
  })
}

export function setMDAReadTag(val) {
  return request({
    url: '/new-item/setMDAReadTag',
    method: 'post',
    data: { ids: val }
  })
}

export function deleteItem(val, rejectMsg) {
  return request({
    url: '/new-item/deleteItem',
    method: 'post',
    data: { ids: val, rejectMsg: rejectMsg }
  })
}

export function automationRekey(val) {
  return request({
    url: '/new-item/automationRekey',
    method: 'post',
    data: { ids: val }
  })
}

export function batchRetryReject(val, rejectRemark) {
  return request({
    url: '/new-item/batchRetryReject',
    method: 'post',
    data: { ids: val, rejectMsg: rejectRemark }
  })
}

export function urgentHandle(val) {
  return request({
    url: '/new-item/urgentHandle?batchRecordId=' + val,
    method: 'get'
  })
}

export function importNewItemListData(data) {
  return request({
    url: '/new-item/importNewItemListData',
    headers: { 'Content-Type': 'multipart/form-data' },
    method: 'put',
    timeout: 600000,
    data
  })
}

export function batchDeleteNewItemListData(val) {
  return request({
    url: '/new-item/batchDeleteNewItemListData',
    method: 'post',
    data: { ids: val }
  })
}

export function nicAudit() {
  return request({
    url: '/new-item/nicAudit',
    method: 'get'
  })
}

export function getOnlineBuildingProducts(data) {
  return request1({
    url: '/item-coi-vendor-mgmt-sku/skuInfo/queryOnlineBuiltSkuPage',
    method: 'post',
    data
  })
}
